<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%sys_balance}}".
 *
 * @property integer $id
 * @property integer $uid
 * @property string $password
 * @property integer $created_at
 */
class SysBalance extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%sys_balance}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['uid'], 'required'],
            [['uid', 'created_at'], 'integer'],
            [['password'], 'string', 'max' => 120]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'uid' => 'Uid',
            'password' => 'Password',
            'created_at' => 'Created At',
        ];
    }
    
    public function getBlanceuid($uid){
        return static::findOne(['uid' => $uid]);
    }
}
